package com.nuoniu.sibanyun.entity.so;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 销售单明细
 * </p>
 *
 * @author 小啊刚
 * @since 2020-12-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("scs_order_detail")
@ApiModel(value="VSaleOrderDetail对象", description="销售单明细")
public class VSaleOrderDetail extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "租户id")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "账套id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "销售订单id")
    @TableField("order_id")
    private Integer orderId;

    @ApiModelProperty(value = "项目id")
    @TableField("project_id")
    private Integer projectId;

    @ApiModelProperty(value = "项目名称")
    @TableField("project_name")
    private String projectName;

    @ApiModelProperty(value = "项目编码")
    @TableField("project_code")
    private String projectCode;

    @ApiModelProperty(value = "预出仓库ID")
    @TableField("warehouse_id")
    private Integer warehouseId;

    @ApiModelProperty(value = "预出仓库名称")
    @TableField("warehouse_name")
    private String warehouseName;

    @ApiModelProperty(value = "预出仓库编码")
    @TableField("warehouse_code")
    private String warehouseCode;

    @ApiModelProperty(value = "物料id")
    @TableField("inventory_id")
    private Integer inventoryId = 0;

    @ApiModelProperty(value = "物料名称")
    @TableField("inventory_name")
    private String inventoryName;

    @ApiModelProperty(value = "物料编码")
    @TableField("inventory_code")
    private String inventoryCode;

    @ApiModelProperty(value = "规格型号")
    @TableField("inventory_specification")
    private String inventorySpecification;

    @ApiModelProperty(value = "单计量id")
    @TableField("unit_id")
    private Integer unitId;

    @ApiModelProperty(value = "计量单位组ID")
    @TableField("unit_group_id")
    private Integer unitGroupId;

    @ApiModelProperty(value = "主计量")
    @TableField("base_unit")
    private Integer baseUnit;

    @ApiModelProperty(value = "主计量名称")
    @TableField("base_unit_name")
    private String baseUnitName;

    @ApiModelProperty(value = "数量")
    @TableField("base_quantity")
    private BigDecimal baseQuantity;

    @ApiModelProperty(value = "辅计量")
    @TableField("sub_unit")
    private Integer subUnit;

    @ApiModelProperty(value = "辅计量名称")
    @TableField("sub_unit_name")
    private String subUnitName;

    @ApiModelProperty(value = "辅计量数量")
    @TableField("sub_quantity")
    private BigDecimal subQuantity;

    @ApiModelProperty(value = "换算率")
    @TableField("unit_exchange_rate")
    private BigDecimal unitExchangeRate;

    @ApiModelProperty(value = "税率")
    @TableField("tax_rate")
    private BigDecimal taxRate;

    @ApiModelProperty(value = "单价")
    @TableField("price")
    private BigDecimal price;

    @ApiModelProperty(value = "金额")
    @TableField("amount")
    private BigDecimal amount;

    @ApiModelProperty(value = "税额")
    @TableField("tax")
    private BigDecimal tax;

    @ApiModelProperty(value = "含税单价")
    @TableField("include_tax_price")
    private BigDecimal includeTaxPrice;

    @ApiModelProperty(value = "含税金额")
    @TableField("include_tax_amount")
    private BigDecimal includeTaxAmount;

    @ApiModelProperty(value = "预计交货日期")
    @TableField("delivery_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate deliveryDate;

    @ApiModelProperty(value = "外币单价")
    @TableField("foreign_price")
    private BigDecimal foreignPrice;

    @ApiModelProperty(value = "外币金额")
    @TableField("foreign_amount")
    private BigDecimal foreignAmount;

    @ApiModelProperty(value = "外币税额")
    @TableField("foreign_tax")
    private BigDecimal foreignTax;

    @ApiModelProperty(value = "外币含税单价")
    @TableField("foreign_include_tax_price")
    private BigDecimal foreignIncludeTaxPrice;

    @ApiModelProperty(value = "外币含税金额")
    @TableField("foreign_include_tax_amount")
    private BigDecimal foreignIncludeTaxAmount;

    @ApiModelProperty(value = "备注")
    @TableField("remarks")
    private String remarks;

    @ApiModelProperty(value = "自定义字段数据")
    @TableField("define_fields")
    private String defineFields;

    @ApiModelProperty(value = "来源单id")
    @TableField("source_voucher_id")
    private Integer sourceVoucherId;

    @ApiModelProperty(value = "来源单号")
    @TableField("source_voucher_code")
    private String sourceVoucherCode;

    @ApiModelProperty(value = "来源日期")
    @TableField("source_voucher_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate sourceVoucherDate;

    @ApiModelProperty(value = "来源单据")
    @TableField("source_voucher_type")
    private String sourceVoucherType;

    @ApiModelProperty(value = "价格标准ID")
    @TableField("price_standard_id")
    private Integer priceStandardId;

    @ApiModelProperty(value = "价格标准名称")
    @TableField("price_standard_name")
    private String priceStandardName;

    @ApiModelProperty(value = "累计发货数量")
    @TableField("total_send_quantity")
    private BigDecimal totalSendQuantity;

    @ApiModelProperty(value = "累计发货金额")
    @TableField("total_send_amount")
    private BigDecimal totalSendAmount;

    @ApiModelProperty(value = "累计开票数量")
    @TableField("total_invoice_quantity")
    private BigDecimal totalInvoiceQuantity;

    @ApiModelProperty(value = "累计开票金额")
    @TableField("total_invoice_amount")
    private BigDecimal totalInvoiceAmount;

    @ApiModelProperty(value = "累计开票辅计量数量")
    @TableField("total_invoice_sub_unit_quantity")
    private BigDecimal totalInvoiceSubUnitQuantity;


    @ApiModelProperty(value = "来源明细ID")
    @TableField("source_detail_id")
    private Integer sourceDetailId;

    @ApiModelProperty(value = "累计执行数量")
    @TableField("cum_execute_quantity")
    private BigDecimal cumExecuteQuantity;

    @ApiModelProperty(value = "累计执行情况")
    @TableField(exist = false)
    private String cumExecuteJson;

    @ApiModelProperty("是否已参与运算0:否1:是")
    @TableField("is_operation")
    private Boolean isOperation;

    @ApiModelProperty(value = "是否生成 主生产计划")
//    @TableField("is_generate_work_plan")
    private Boolean isGenerateWorkPlan;

    @ApiModelProperty(value = "涂装方式:氟碳二涂,氟碳三涂,氟碳四涂,粉末,聚酯,氟碳打点,仿木纹,真石漆")
    @TableField("coating_method")
    private String coatingMethod;

    @ApiModelProperty(value = "技术要求说明:打标,加强筋,角码,折边")
    @TableField("technology_note")
    private String technologyNote;

    @ApiModelProperty(value = "包装要求:有字膜,无字膜,纸皮,泡泡膜,木箱")
    @TableField("pack_require")
    private String packRequire;

    @ApiModelProperty(value = "西亚/产品编号")
    @TableField("no")
    private String no;
}
